/*
 * @Author: Clark
 * @Email: haixuanwoTxh@gmail.com
 * @Date: 2023-01-09 17:56:30
 * @LastEditors: Clark
 * @LastEditTime: 2023-01-09 17:57:37
 * @Description: file content
 */

#include <signal.h>
#include <unistd.h>

static void sig_alrm(int signo)
{
    printf("game over\n");
}

unsigned int sleep1(unsigned int seconds)
{
    if (signal(SIGALRM, sig_alrm) == SIG_ERR)
    {
        return seconds;
    }

    alarm(seconds);
    pause();

    return alarm(0);
}
